export default {
  namespace: 'baseInfoModify',
  state:{
    modalControl: false,
    content: ''
  },
  subscriptions: {
    setup ({ dispatch, history }) {
      history.listen((location) => {
        // 用户刷新页面时候请求编排接口
        if (location.pathname === '/baseInfoModify') {
          dispatch({
            type: 'modules/getModules',
            payload: {
              pathname: '',
              businessId: '1231241229',
              process: 'baseInfoModify',
              title: '基本信息修改'
            }
          })
        }
      })
    }
  },
  effects: {
    *modalControlAction ( { payload } , { put }) {
      yield put({
        type: 'changeModal',
        ...payload
      })
    },
  },
  reducers: {
    changeModal (state, { payload }) {
      return {
        ...state,
        ...payload
      }
    }
  }
}